Skip to content

Add metric sources UI and custom alert targets (metric alerts phase 2) - #340

Merged
acoshift merged 1 commit into
mainfrom
feat/custom-metrics
Sep 3, 2026
Merged

Add metric sources UI and custom alert targets (metric alerts phase 2)#340
acoshift merged 1 commit into
mainfrom
feat/custom-metrics

Conversation

@acoshift

@acoshift acoshift commented Sep 2, 2026

Copy link
Copy Markdown
Member

Phase 2 of metric alerts: scrape-source config, custom charts, and custom alert targets.

What

  • Metric sources (/metrics-sources, preview nav after Alerts): list (name, location/deployment, port, path, status), set form (create+edit; deployment + port + path, no URL), and detail (series table + RangeSwitch + Chart.svelte). Truncated/error banners from truncated / lastError.
  • Deployment metrics Custom tab: shown when a source targets that deployment; series multi-select, time range, chart, same banners.
  • Alert target kind toggle: Deployment (existing location+deployment+cpu/memory/requests/egress) or Custom (kind: custom, source, series, metric value|rate). Custom payloads omit location/deployment. Default remains deployment so existing create tests keep sending { location, deployment } without kind.

Permissions use GuardedButton / can('metricSource.set') (and get/list/delete).

Screenshots

List (ok / truncated / error) Create (no URL)
list create
Source detail banners Deployment Custom tab
detail deployment custom

Alert create — Custom kind

Tests

bun run lint, bun run check, and bun run test (Playwright, 407 passed). Coverage includes:

  1. Source list shows ok / truncated / error
  2. Set form submits metricSource.set with deployment+port+path (no url field)
  3. Custom chart empty / error / truncated banners (source detail + deployment Custom tab)
  4. Alert form Custom: pick source + series, submit alert.create with kind: custom and no deployment

Mock fixtures for metricSource.{set,get,list,delete,series,query} (ok / truncated / scrape-error sources; gauge + counter series).

Project-level /metrics-sources list, set form, and detail chart; a Custom
tab on matching deployment metrics; and an alert target-kind toggle for
custom metric-source series. Preview nav. Mock fixtures and Playwright
coverage for list statuses, set payload, chart banners, and custom alerts.
@deploys-app
deploys-app Bot temporarily deployed to pr-340 September 2, 2026 08:15 Destroyed
@deploys-app

deploys-app Bot commented Sep 2, 2026

Copy link
Copy Markdown

Preview deleted (PR closed).

@acoshift
acoshift merged commit d9e0ea6 into main Sep 3, 2026
5 checks passed
@acoshift
acoshift deleted the feat/custom-metrics branch September 3, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant